/*
 * Copyright (C) 2004, Velocityme Partnership
 * AnchorValueActionForm.java
 *
 * Created on 25 November 2004, 07:39
 */

package com.velocityme.www.actionforms.nodeactionforms;

import com.velocityme.entity.Anchor;
import com.velocityme.session.KeyLocal;
import java.util.Calendar;

/**
 *
 * @author  Robert
 */
public class AnchorActionForm extends TaskActionForm {
    
    private int m_year;
    private int m_month;
    private int m_day;

    public void extractAnchor(KeyLocal key, Anchor anchor) {
        extractTask(key, anchor);
        Calendar date = Calendar.getInstance(); date.clear();
        date.set(getYear(), getMonth(), getDay());
        anchor.setStartDate(date.getTime());
    }

    public void setDate(Calendar date) {
        setYear(date.get(Calendar.YEAR));
        setMonth(date.get(Calendar.MONTH));
        setDay(date.get(Calendar.DATE));
    }
    
    public int getYear() { 
        return m_year;
    }
    
    public void setYear(int year) {
        m_year = year;
    }
    
    public int getMonth() {
        return m_month;
    }
    
    public void setMonth(int month) {
        m_month = month;
    }
    
    public int getDay() {
        return m_day;
    }
    
    public void setDay(int day) {
        m_day = day;
    }
    
}
